/*
B. GCD Compression
cf_20_6_20_1370B
*/
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int maxn=1e5+10;
int a[maxn];
int b1[maxn];
int b2[maxn];
int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		int n;
		scanf("%d",&n);
		int cnt1=0,cnt2=0;
		for(int i=1;i<=2*n;i++)
		{
			scanf("%d",&a[i]);
			if(a[i]%2==0) 
			{
				b2[++cnt2]=i;
			}
			else 
			{
				b1[++cnt1]=i;
			}
		}
		if(cnt2%2==0)
		{
			if(cnt2>=2)
			{
				for(int i=1;i<=cnt2-2;i+=2)
				{
					printf("%d %d\n",b2[i],b2[i+1]);
				}
				for(int i=1;i<=cnt1;i+=2)
				{
					printf("%d %d\n",b1[i],b1[i+1]);
				}
			}
			else if(cnt1>=2)
			{
				for(int i=1;i<=cnt2;i+=2)
				{
					printf("%d %d\n",b2[i],b2[i+1]);
				}
				for(int i=1;i<=cnt1-2;i+=2)
				{
					printf("%d %d\n",b1[i],b1[i+1]);
				}
			}
		}
		else if(cnt2%2==1)
		{
			for(int i=2;i<=cnt1;i+=2)
			{
				printf("%d %d\n",b1[i],b1[i+1]);
			}
			for(int i=2;i<=cnt2;i+=2)
			{
				printf("%d %d\n",b2[i],b2[i+1]);
			}
		}
	}
}
